﻿/// <reference path="../_references.js" />
(function () {
    commonTests = TestCase("commonTests");
    var testObj1 = { f1: function () {
    },
        f2: "string"
    };
    var testObj2 = {
        p1:"1",
        p2:"2",
    };
    var testObj3= {
        p2:"2",
        p1:"1"
    };
    var testObj4={
        p1:"1",
        p2:"3"
    };
    var testObj5={
        p1:"1"
    };
    var testObj6={
        p1:"1",
        p2:"2",
        p3:"3"
    };
    commonTests.prototype = {
        "test hasFunction method": function () {
            assertEquals(true, Object.hasFunction(testObj1, "f1", false));
            assertEquals(false, Object.hasFunction(testObj1, "f2", false));
            assertEquals(false, Object.hasFunction(testObj1, "f3", false));
        },
        "test if hasFunction method fails when function is undefined and throwing exceptions is on": function () {
            var fail = false;
            try { Object.hasFunction(testObj1, "f3", true); }
            catch (ex)
            { fail = true; }
            assertEquals(true, fail);
        },
        "test stateequals compare identical string objects should return true": function () {
            assertEquals(true, Object.stateEquals( testObj2,testObj3));
        }
    };
})();